<HTML>
	<TITLE>Workflow.NET
		<%#actionname%>
		-<%#propertyname%></TITLE>
	<STYLE><%#stylesheet%>
	</STYLE>
	<BODY marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">
		<form name="wf_theform" method="post">
			<TABLE width="100%" height="100%" bgcolor="<%#bgcolor%>" cellspacing="0" cellpadding="0" border="0">
				<TR>
					<TD valign="top">
						<TABLE width="100%" height="100%">
							<TR>
								<TD valign="top">
									<IFRAME name="frame_newinputs" src="<%#requeststring%>&amp;pagesection=inputframe&amp;_pageinfo=<%#pageinfo%>&amp;_mode=<%#mode%>&amp;_fieldcount=<%#fieldcount%>" width="100%" height="100%">
									</IFRAME>
								</TD>
							</TR>
						</TABLE>
					</TD>
				</TR>
				<TR>
					<TD height="1" bgcolor="black"><IMG src="?drawimage=spacer.gif" height="1" width="1"></TD>
				</TR>
				<TR>
					<TD height="1" bgcolor="white"><IMG src="?drawimage=spacer.gif" height="1" width="1"></TD>
				</TR>
				<TR>
					<TD align="middle" height="50">
						<TABLE bgcolor="white">
							<TR>
								<TD colspan=2>
									Map Custom fields to variables/contents or values.
								</TD>
							</TR>
						</TABLE>
					</TD>
				</TR>
				<TR>
					<TD height="1" bgcolor="black"><IMG src="?drawimage=spacer.gif" height="1" width="1"></TD>
				</TR>
				<TR>
					<TD height="1" bgcolor="white"><IMG src="?drawimage=spacer.gif" height="1" width="1"></TD>
				</TR>
				<TR>
					<TD align="right" height="30" width="100%">
						<input type="button" class="buttons" value="Back" name="btnback" id="btnback" onclick="window.history.back();">
						<input type="button" class="buttons" value="Save" name="btnsavet" id="btnsave" onclick="javascript:nextstep('<%#mode%>', 'page2','')">&nbsp;&nbsp;
						<input type="button" class="buttons" value="Cancel" ID="btnCancel" onclick="window.close();" NAME="btnCancel">
					</TD>
				</TR>
			</TABLE>
			<input type="hidden" name="_hidtempstore" id="_hidtempstore">
			<input type="hidden" name="_mode" ID="_mode">
			<input type="hidden" name="_pageinfo" id="_pageinfo">
		</form>
		<SCRIPT>

	function nextstep(mode,pageinfo,tempstore)
	{
		var frameinputs = getframeinputs()
		if (frameinputs.length>0)
		{
			tempstore +=frameinputs;
			document.wf_theform._mode.value=mode;
			document.wf_theform._pageinfo.value = pageinfo;
			document.wf_theform._hidtempstore.value=tempstore;
			document.wf_theform.submit()
		}
	}

	function getframeinputs()
	{
		var i=0;
		var returnvalue="";
		var obj = eval("frame_newinputs");
		var tempobj;
		var d = obj.document
		var questiontype="";
		var temp="";

		if (parseInt(d.wf_theform.fieldcount.value)> 0 )
		{
			for ( i = 0 ;i<parseInt(d.wf_theform.fieldcount.value);i++)
			{
				tempobj = eval("d.wf_theform.txtFieldName" + i)
				temp = tempobj.value
				if(temp.indexOf(" ") >= 0 )
				{
					alert("Custom field name cannot have space.");
					return false;
				}
				if (temp.length > 0)
				{
					//Identifier
					tempobj = eval("d.wf_theform.hidFieldIdentifier" + i)
					returnvalue += "#" + tempobj.value +";"+ temp;
					tempobj = eval("d.wf_theform.SelectType" + i)
					returnvalue += ";" + tempobj.value;
					tempobj = typeof(eval("d.wf_theform.valueinput["+i+"]"))
					if( tempobj == "undefined" || d.wf_theform.fieldcount.value == 1)
						returnvalue += ";"+ eval("d.wf_theform.valueinput.value");
					else
						returnvalue += ";"+ eval("d.wf_theform.valueinput["+i+"].value");

					tempobj = eval("d.wf_theform.txtFieldDispName" + i)
					if(tempobj.value.length == 0 )
						tempobj = eval("d.wf_theform.txtFieldName" + i)

					returnvalue += ";" + tempobj.value;


				}
			}
			if (returnvalue.length==0)
			{
				alert("1 or more custom fields have an incorrect definition.");
				return "";
			}
			if (returnvalue.length > 0)
					returnvalue = returnvalue.substring(1,returnvalue.length)
		}
		return returnvalue;
	}
		</SCRIPT>
	</BODY>
</HTML>
